package com.sunyard.utils.manage;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.List;

/**
 *  * @Description:数据表格类
 *  * @author:zhangbo
 *  * @date:2017年7月12日 下午2:48:40
 *  
 */
@ApiModel
public class DataGrid<T> implements Serializable {

    /**
     * @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么)
     */
    private static final long serialVersionUID = 2295082701495609222L;

    /**
     * @fields (int)total : 总数
     */
    @ApiModelProperty(value = "总数")
    private int total;

    /**
     * 当前页
     */
    @ApiModelProperty(value = "当前页")
    private int pageNum;

    /**
     *
     * */

    /**
     * @fields (List < T >)rows : 展示列
     */
    @ApiModelProperty(value = "展示列")
    private List<T> rows;

    /**
     * @title DataGrid
     * @description 构造函数
     */
    public DataGrid() {
    }

    /**
     * @param total
     * @param rows
     * @param pageNum
     * @title DataGrid
     * @description 构造函数，带参数
     */
    public DataGrid(int total, int pageNum, List<T> rows) {
        this.total = total;
        this.rows = rows;
        this.pageNum = pageNum;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getPageNum() {
        return this.pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public List<T> getRows() {
        return rows;
    }

    public void setRows(List<T> rows) {
        this.rows = rows;
    }

    @Override
    public String toString() {
        return "DataGrid [total=" + total + ", rows=" + rows + ",pageNum=" + pageNum + "]";
    }

}
